
public class Goleste21 extends Operator {

	public Cana execute(Cana cc){
		Cana c = cc;
		int cantitateCeTrebuieTransferata = 3 - c.getX();
		int cantitateTransferata;
		if(cantitateCeTrebuieTransferata < c.getY())
			cantitateTransferata = cantitateCeTrebuieTransferata;
		else
			cantitateTransferata = c.getY();
		c.setY(c.getY() - cantitateTransferata);
		c.setX(c.getX() + cantitateTransferata);
		return c ;
	}
	public boolean valabil(Cana c){
		boolean r = false;
		if((c.getY() > 0) && (c.getY() <= 4) && (c.getX()<3))
			r = true;
		return r;
	}
}
